package com.ctrl.riveradministrator.mvp.presenter;

import android.util.Log;

import com.ctrl.riveradministrator.base.BaseObserver;
import com.ctrl.riveradministrator.base.BasePresenter;
import com.ctrl.riveradministrator.mvp.model.SceneryShare;
import com.ctrl.riveradministrator.mvp.view.activity.learn_zoom.LearnZoomView;
import com.ctrl.riveradministrator.mvp.view.activity.scenery_share.SceneryShareView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ScenerySharePresenter extends BasePresenter<SceneryShareView> {

    public ScenerySharePresenter(SceneryShareView baseView) {
        super(baseView);
    }

    public void getScenery(String pageNumb, String pageSize){
        Map<String, String> map = new HashMap<>();
        map.put("pageNumb", pageNumb);
        map.put("pageSize", pageSize);
        attachView(apiService.getScenery(map), new BaseObserver<SceneryShare>(getBaseView()) {

            @Override
            public void onSuccess(SceneryShare model) {
                Log.d("Tgh", "onSuccess: ");
            }

            @Override
            public void onSuccess(List<SceneryShare> model) {
                getBaseView().showMessage(model);
            }

            @Override
            public void onFailed(String msg) {
                Log.d("Tgh", "onFailed: " + msg);
            }
        });
    }
}
